<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            position: fixed;
            top:0;
            left: 0;
            height:50px;
            width: 50px;
            border: solid 2px #999;
            border-radius: 50%;
        }
    </style>
</head>
<body>
<div></div>
<script>
    let obox = document.querySelector("div")
    let timer;
    timer = setInterval(function(){
        if (obox.offsetLeft>=500){
            clearInterval(timer);
        } else{
            obox. style.Top = obox.offsetTop + 10+"px";
            obox. style.left = obox.offsetLeft + 10+"px";
        }

    }, 50)

    function random(max, min) {
        return Math.round(Math.random() * (max - min) + min);
    }

</script>
</body>
</html>